namespace CollegeReviewMVC.Migrations
{
    using CollegeReviewMVC.Model;
    using System;
    using System.Data.Entity;
    using System.Data.Entity.Migrations;
    using System.Linq;

    internal sealed class Configuration : DbMigrationsConfiguration<CollegeReviewMVC.Models.ApplicationDbContext>
    {
        public Configuration()
        {
            AutomaticMigrationsEnabled = false;
        }

        protected override void Seed(CollegeReviewMVC.Models.ApplicationDbContext context)
        {
            //  This method will be called after migrating to the latest version.

            //  You can use the DbSet<T>.AddOrUpdate() helper extension method 
            //  to avoid creating duplicate seed data. E.g.
            //
            //    context.People.AddOrUpdate(
            //      p => p.FullName,
            //      new Person { FullName = "Andrew Peters" },
            //      new Person { FullName = "Brice Lambson" },
            //      new Person { FullName = "Rowan Miller" }
            //    );
            //

            context.Colleges.AddOrUpdate(
                p => p.CollegeId,
                new College { CollegeId = 1, CollegeName = "CoderCamps"},
                new College { CollegeId = 2, CollegeName = "University of Houston"},
                new College { CollegeId = 3, CollegeName = "College of the Mainland"}
                );
            context.Reviews.AddOrUpdate(
                p => p.ReviewId,
                new Review { CollegeId = 1, ReviewId = 1, ReviewPost = "Awesome experience full of rich challenges!", DatePosted = DateTime.Now, Rating = 1},
                new Review { CollegeId = 1, ReviewId = 2, ReviewPost = "Super tough skills to pick up, overall very challenging!", DatePosted = DateTime.Now, Rating = 1 },
                new Review { CollegeId = 2, ReviewId = 3, ReviewPost = "Great community, wide range of majors, and wonderful administration.", DatePosted = DateTime.Now, Rating = 3},
                new Review { CollegeId = 3, ReviewId = 4, ReviewPost = "Wonderful learning environment, assistance for any aspect of education easily found!", DatePosted = DateTime.Now, Rating =5}
                );
        }
    }
}
